import { Tools } from 'weaver-mobile'

export const checkNewMap = params => {
    return Tools.callApi({
        url: "/api/workrelate/task/checknew",
        method: "GET",
        params,
        type: "json"
    })
}

export const getTaskList = params => {   //任务列表
    return Tools.callApi({
        url: "/api/workrelate/task/getTaskList",
        method: "GET",
        params,
        type: "json"
    })
}

export const getMoreTaskList = params => {   //更多任务列表
    return Tools.callApi({
        url: "/api/workrelate/task/getMoreList",
        method: "GET",
        params,
        type: "json"
    })
}

export const getChildTaskList = params => {   //子任务列表
    return Tools.callApi({
        url: "/api/workrelate/task/getChildTaskList",
        method: "GET",
        params,
        type: "json"
    })
}

export const changeTaskStatus = params => {   //修改任务状态
    return Tools.callApi({
        url: "/api/workrelate/task/changeStatus",
        method: "GET",
        params,
        type: "json"
    })
}

export const setSpecial = params => {   //添加关注或取消关注
    return Tools.callApi({
        url: "/api/workrelate/task/setSpecial",
        method: "GET",
        params,
        type: "json"
    })
}

export const addTask = params => {   //新增任务
    return Tools.callApi({
        url: "/api/workrelate/task/addTask",
        method: "POST",
        params,
        type: "json"
    })
}

export const getTaskDetail = params => {   //获取任务详情
    return Tools.callApi({
        url: "/api/workrelate/task/getTaskDetail",
        method: "GET",
        params,
        type: "json"
    })
}

export const getTaskLog = params => {   //获取操作日志  
    return Tools.callApi({
        url: "/api/workrelate/task/taskOperation",
        method: "GET",
        params,
        type: "json"
    })
}

export const editTaskInfo = params => {   //修改任务详情
    return Tools.callApi({
        url: "/api/workrelate/task/editTaskInfo",
        method: "POST",
        params,
        type: "json"
    })
}

export const addTaskFbInfo = params => {  //添加反馈
    return Tools.callApi({
        url: "/api/workrelate/task/addTaskFbInfo",
        method: "POST",
        params,
        type: "json"
    })
}

export const taskOperation = params => {   //删除反馈 //获取反馈
    return Tools.callApi({
        url: "/api/workrelate/task/taskOperation",
        method: "GET",
        params,
        type: "json"
    })
}

export const taskListComment = params => {   //移动端获取任务评论列表
    return Tools.callApi({
        url: "/api/workrelate/task/mobile/taskListComment",
        method: "POST",
        params,
        type: "json"
    })
}

export const taskUpdateInfo = params => {   //移动端任务保存
    return Tools.callApi({
        url: "/api/workrelate/task/mobile/taskUpdateInfo",
        method: "POST",
        params,
        type: "json"
    })
}

export const getSubTaskList = params => {   //任务详情页页子列表查询
    return Tools.callApi('/api/workrelate/task/getSubTaskList', 'GET', params);
}

export const taskViewOperation = params => {   //记住任务视图
    return Tools.callApi({
        url: "/api/workrelate/task/taskViewInfo",
        method: "POST",
        params,
        type: "json"
    })
}

export const checkHasRigth = params => {   //模块权限判断
    return Tools.callApi({
        url: "/api/workrelate/common/checkHasRigth",
        method: "GET",
        params,
        type: "json"
    })
}

export const viewDocFiled = params => {   //给相关附件权限
    return Tools.callApi('/api/workrelate/common/viewDocFiled', 'POST', params);
}

export const tagOperate = params => {   // 标签相关操作
    return Tools.callApi({
        url: "/api/workrelate/task/taskTag",
        method: "POST",
        params,
        type: "json"
    })
}

// export const dataKey = params => {   // 获取dataKey的数据
//     return Tools.callApi({
//         url: "/api/ec/dev/table/datas",
//         method: "POST",
//         params,
//         type: "json"
//     })
// }